Skip to content

Feature/62 rn splash screen#63

Open
tccmw wants to merge 3 commits intomainfrom
feature/62-rn-splash-screen
Open

Feature/62 rn splash screen#63
tccmw wants to merge 3 commits intomainfrom
feature/62-rn-splash-screen

Conversation

@tccmw
Copy link
Copy Markdown
Member

@tccmw tccmw commented Dec 14, 2025

Summary by CodeRabbit

  • New Features

    • Added an app launch splash screen that displays on startup and is hidden automatically for a smoother launch experience.
  • Chores

    • Updated Android app configuration and themes to support the splash screen and included splash assets.
    • Added required Android internet permission and necessary runtime support package.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 14, 2025

Walkthrough

Adds react-native-bootsplash: initializes it in Android MainActivity, provides Android theme/resources/manifest entries, installs the dependency, and hides the splash from the React App component on mount.

Changes

Cohort / File(s) Summary
React app change
App.tsx
Import useEffect and react-native-bootsplash; remove useState and two state vars; call RNBootSplash.hide({ fade: true }) in useEffect on mount.
Android activity init
android/app/src/main/java/com/oil/MainActivity.kt
Added onCreate override calling RNBootSplash.init(this) and imported android.os.Bundle and RNBootSplash.
AndroidManifest updates
android/app/src/main/AndroidManifest.xml
Added <uses-permission android:name="android.permission.INTERNET" />; adjusted <application> attributes; replaced MainActivity <activity> block to use BootTheme and new lifecycle/config attributes.
Android resources
android/app/src/main/res/values/colors.xml, android/app/src/main/res/values/styles.xml
Added bootsplash_background color and BootTheme style (parent Theme.BootSplash) with splash items and post-splash theme reference.
Bootsplash assets
assets/bootsplash/manifest.json
New bootsplash manifest with background #ffffff and logo dimensions (160×120).
Dependency
package.json
Added dependency react-native-bootsplash version ^6.3.11.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant System as Android OS
    participant MA as MainActivity
    participant RNB as RNBootSplash
    participant App as React App (App.tsx)
    participant UI as App UI

    System->>MA: create activity
    MA->>RNB: RNBootSplash.init(this)
    RNB->>UI: display native splash (background + logo)
    System->>App: start JS bundle / mount App component
    App->>RNB: useEffect -> RNBootSplash.hide({fade:true})
    RNB->>UI: fade out splash
    UI->>App: reveal React UI
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Files to focus on:
    • MainActivity.kt — ensure init timing and imports are correct.
    • AndroidManifest.xml — verify merged attributes and BootTheme usage.
    • assets/bootsplash/manifest.json and styles.xml — confirm asset paths and drawable references.
    • App.tsx — confirm removing state vars doesn't alter navigation/startup behavior.

Possibly related PRs

Poem

🐰 I waited in white, snug in a shell,

A boot of brightness before all is well.
I hopped to the code, gave the splash a nudge,
Fade into view — the app and my fudge.
Hooray, little launch — a rabbit's soft judge.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feature/62 rn splash screen' accurately describes the main change: implementing a React Native splash screen feature using react-native-bootsplash library, evident from all modified files.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/62-rn-splash-screen

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 55b5bc9 and 41d49c9.

📒 Files selected for processing (1)
  • android/app/src/main/java/com/oil/MainActivity.kt (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • android/app/src/main/java/com/oil/MainActivity.kt

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
App.tsx (1)

27-29: LGTM: Splash screen integration is correctly implemented.

The RNBootSplash.hide({ fade: true }) call in the useEffect hook with an empty dependency array ensures the splash screen is hidden once on component mount with a fade transition.

Consider adding error handling for robustness:

 useEffect(() => {
-  RNBootSplash.hide({ fade: true });
+  RNBootSplash.hide({ fade: true }).catch((error) => {
+    console.warn('Failed to hide boot splash:', error);
+  });
 }, []);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07d10dd and 55b5bc9.

⛔ Files ignored due to path filters (12)
  • android/app/src/main/res/drawable-hdpi/bootsplash_logo.png is excluded by !**/*.png
  • android/app/src/main/res/drawable-mdpi/bootsplash_logo.png is excluded by !**/*.png
  • android/app/src/main/res/drawable-xhdpi/bootsplash_logo.png is excluded by !**/*.png
  • android/app/src/main/res/drawable-xxhdpi/bootsplash_logo.png is excluded by !**/*.png
  • android/app/src/main/res/drawable-xxxhdpi/bootsplash_logo.png is excluded by !**/*.png
  • assets/bootsplash/logo.png is excluded by !**/*.png
  • assets/bootsplash/logo@1,5x.png is excluded by !**/*.png
  • assets/bootsplash/logo@2x.png is excluded by !**/*.png
  • assets/bootsplash/logo@3x.png is excluded by !**/*.png
  • assets/bootsplash/logo@4x.png is excluded by !**/*.png
  • package-lock.json is excluded by !**/package-lock.json
  • src/assets/splashLogo.png is excluded by !**/*.png
📒 Files selected for processing (7)
  • App.tsx (2 hunks)
  • android/app/src/main/AndroidManifest.xml (1 hunks)
  • android/app/src/main/java/com/oil/MainActivity.kt (2 hunks)
  • android/app/src/main/res/values/colors.xml (1 hunks)
  • android/app/src/main/res/values/styles.xml (1 hunks)
  • assets/bootsplash/manifest.json (1 hunks)
  • package.json (1 hunks)
🔇 Additional comments (6)
android/app/src/main/res/values/colors.xml (1)

1-3: LGTM!

The bootsplash color resource is correctly defined and matches the background color specified in the bootsplash manifest.

android/app/src/main/java/com/oil/MainActivity.kt (1)

19-19: LGTM: Correct placement of RNBootSplash initialization.

The RNBootSplash.init(this) call is correctly placed after super.onCreate(), which is the recommended initialization order for native modules.

android/app/src/main/res/values/styles.xml (1)

7-11: LGTM!

The BootTheme style is correctly configured with:

  • Proper parent theme (Theme.BootSplash)
  • Reference to bootsplash color and logo resources
  • Correct transition to AppTheme via postBootSplashTheme
android/app/src/main/AndroidManifest.xml (2)

20-20: LGTM: BootTheme correctly applied to MainActivity.

The android:theme="@style/BootTheme" attribute on the MainActivity is correctly placed to enable the splash screen during activity launch.


9-9: Note: Backup functionality is disabled.

The android:allowBackup="false" setting disables Android's automatic backup for app data. This is intentional for privacy/security but means users will lose app data if they reinstall or switch devices.

Verify this is the intended behavior for your app's data retention policy.

package.json (1)

25-25: react-native-bootsplash 6.3.11 is compatible with React 19 and React Native 0.83.

React Native 0.83 uses React 19 (specifically React 19.2), and react-native-bootsplash 6.3.11 supports the latest RN version plus two previous minor series. No compatibility issues expected, though test on target platforms and check the repo for any platform-specific edge cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant